#
# Simple makefile to illustrate
# how to build a project using RebeccaAIML
#

#
# Where you installed the distribution
#
prefix=@BUILD_prefix@


# Where you wanted the the lib
# to be located.  This is usually
# the same place as the prefix.
#
exec_prefix=@BUILD_exec_prefix@


#
# Where the rebecca includes are
#
REBECCA_INCLUDES=@BUILD_includedir@

#
# Where the rebecca shared object and
# executable is to go
#
REBECCA_LIB=@BUILD_libdir@

#
# Where to output the sample
#
REBECCA_OUTPUT=@BUILD_datadir@/Rebecca/bin/release

#
# List of all the objects 
# that are to go into the shared object
#
#
SHARED_OBJS=CustomAIML.o\
	        CustomTagsImpl.o\
			CustomTopic.o\
			Html.o\
			InnerTemplateAIMLTags.o\
			Links.o\
			sanitizeString.o\
			WebPage.o

all: ${REBECCA_LIB}/libcustomHtmlTagLayer.so ${REBECCA_OUTPUT}/consoleAIMLHtmlConverter

${REBECCA_LIB}/libcustomHtmlTagLayer.so: ${SHARED_OBJS} 
	${CXX} -shared -Wl,-soname,libcustomHtmlTagLayer.so -o ${REBECCA_LIB}/libcustomHtmlTagLayer.so ${SHARED_OBJS}

CustomAIML.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC CustomAIML.cpp

CustomTagsImpl.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC CustomTagsImpl.cpp

CustomTopic.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC CustomTopic.cpp

Html.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC Html.cpp

InnerTemplateAIMLTags.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC InnerTemplateAIMLTags.cpp

Links.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC Links.cpp

sanitizeString.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC sanitizeString.cpp

WebPage.o:
	${CXX} -I${REBECCA_INCLUDES} -c -fPIC WebPage.cpp

${REBECCA_OUTPUT}/consoleAIMLHtmlConverter: consoleAIMLHtmlConverter.o
	${CXX} -o ${REBECCA_OUTPUT}/consoleAIMLHtmlConverter consoleAIMLHtmlConverter.o -L${REBECCA_LIB} -lrebecca-mt -Wl,-rpath=${REBECCA_LIB}

consoleAIMLHtmlConverter.o:
	${CXX} -I${REBECCA_INCLUDES} -c consoleAIMLHtmlConverter.cpp 

clean:
	-rm ${SHARED_OBJS}
	-rm ${REBECCA_LIB}/libcustomHtmlTagLayer.so
	-rm ${REBECCA_OUTPUT}/consoleAIMLHtmlConverter

